﻿#region Using
/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2013-3-15
Description:QUARTZ_SQL_LIST.aspx.cs页面代码
=============================================================================	
*/

using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using FineUI;
using FTchina.Logic;
using FTchina.Library;
using FTchina.Models;
using FTchina.BLL;
using PWMIS.DataProvider.Data;
#endregion
public partial class QUARTZ_SQL_LISTaction_cs : BasePage
{

    AdoHelper ado = PWMIS.DataProvider.Adapter.MyDB.GetDBHelperByConnectionName("DYDB");


    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            LoadData();
            string id = RequestHelper.SafeRequest(Request["id"]);
            if (id.Length > 0)
            {
                ShowModData(id);
            }
        }

    }
    private void LoadData()
    {

        // 关闭按钮的客户端脚本：
        // 1. 首先确认窗体中表单是否被修改（如果已经被修改，则弹出是否关闭的确认对话框）
        // 2. 然后关闭本窗体，回发父窗体
        btnClose.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();

    }
    private void ShowModData(string ItemID)
    {
        QUARTZ_SQL_LIST mQUARTZ_SQL_LIST = QUARTZ_SQL_LISTManager.GetByPLUGINNAME((string)ItemID, ado);
        if (mQUARTZ_SQL_LIST != null)
        {
            txbPluginname.Enabled = false; ;
            txbPluginname.Text = mQUARTZ_SQL_LIST.PLUGINNAME.EToString();
            txbAllsql.Text = mQUARTZ_SQL_LIST.ALLSQL.EToString();
            txbBeizhu.Text = mQUARTZ_SQL_LIST.BEIZHU.EToString();
            txbORIGINALSQL.Text = mQUARTZ_SQL_LIST.ORIGINALSQL.EToString();
            txbMobile.Text = mQUARTZ_SQL_LIST.MOBILE.EToString();
        }

    }
    protected void btnSaveContinue_Click(object sender, EventArgs e)
    {
        // 1. 这里放置保存窗体中数据的逻辑
        QUARTZ_SQL_LIST mQUARTZ_SQL_LIST = new QUARTZ_SQL_LIST();

        mQUARTZ_SQL_LIST.PLUGINNAME = txbPluginname.Text.Trim();
        mQUARTZ_SQL_LIST.ALLSQL = txbAllsql.Text.Trim();
        mQUARTZ_SQL_LIST.BEIZHU = txbBeizhu.Text.Trim();
        mQUARTZ_SQL_LIST.LASTUPDATE = DateTime.Now;
        mQUARTZ_SQL_LIST.ORIGINALSQL = txbORIGINALSQL.Text.Trim();
        mQUARTZ_SQL_LIST.MOBILE = txbMobile.Text.EToString();
        AlertLogic.ShowResult(QUARTZ_SQL_LISTManager.AddOrUpdate(mQUARTZ_SQL_LIST, ado) > 0);

        // 2. 关闭本窗体，然后回发父窗体
        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
    }
    //protected void btnSaveRefresh_Click(object sender, EventArgs e)
    //{
    //    // 1. 这里放置保存窗体中数据的逻辑

    //    // 2. 关闭本窗体，然后刷新父窗体
    //    PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
    //}






}






